<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>代理商管理</h2>
    </div>
    <form action="{:U('FuturesUser/agent')}" method="post" class="form-horizontal">
        <input type="hidden" name="id" value="{$id}">
        <div class="form-item">
            <label class="item-label">角色选择<span class="check-tips"></span></label>
            <div class="controls">
                <select name="role" id="role">
                    <option value="1">代理商</option>
                    <option value="2" <if condition="$agentData['pt_role'] eq 2">selected="selected"</if>>做市商</option>
                </select>
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">用户昵称<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" id="username" class="text input-large" name="username" value="{$agentData.user_name}" >
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">密码<span class="check-tips"></span></label>
            <div class="controls">
                <input type="password" id="password" class="text input-large" name="password" value="{$agentData.password}" autocomplete="off">
            </div>
        </div>
        <div class="form-item showtype" style="display: none" >
            <label class="item-label">做市比例<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" style="width: 50px;" class="text input-large" name="zuoshi" value="{$agentData.market}" placeholder="80">%
            </div>
        </div>
        <div class="form-item showtype" style="display: none" >
            <label class="item-label">平台流水比例<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" style="width: 50px;" class="text input-large" name="liushui" value="{$agentData.water}" placeholder="80">%
            </div>
        </div>
        <div class="form-item showtype" style="display: none" >
            <label class="item-label">保证金<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" style="width: 100px;"class="text input-large" name="sure_money" value="{$agentData.sure_money}" >
            </div>
        </div>
        <div class="form-item">
            <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
</block>

<block name="script">
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
    <script type="text/javascript">
        //导航高亮
        $('.side-sub-menu').find('a[href="{:U('FuturesUser/index')}"]').closest('li').addClass('current');
    </script>
    <script type="text/javascript">
        $(function(){
            var role=$("#role").val();
            if(role==2){
                $(".showtype").css('display','block');
            }
            $("#role").change(function(){
                var role=$(this).val();
                if(role==2){
                    $(".showtype").css('display','block');
                }else{
                    $(".showtype").css('display','none');
                }
            })
        })
    </script>
</block>
